﻿using Neuparts.Ordering.Entities;
using NUnit.Framework;
using Neuparts.Ordering.Repositories;

namespace Neuparts.Ordering.Tests.Repository
{
    [TestFixture]
    public class ItemRepositoryTests
    {
        [Test]
        public void CanAddItemToRepository()
        {
            Item item = GenerateItem();

            ItemRepository items = new ItemRepository();
            items.Save(item);

            Assert.IsNotNull(item.Id);
        }

        internal static Item GenerateItem()
        {
            Item item = new Item();
            item.Name = "Test";
            item.SKU = 123;
            item.Description = "Test";
            item.UnitPrice = 4.00M;
            return item;
        }
    }
}
